/**
  CNOK project, Anyang Normal University, IMP-CAS
  \class TARs
  \brief calculate the spectroscopic reduction factor Rs=sig_exp/sig_th for
  intermediate-energy single-nucleon knockout reactions. The main function of
  this class is to calculate the inclusive single-nucleon removal c.s.
  \author SUN Yazhou, asia.rabbit@163.com
  \since 2022/05/23
  \date Last modified: 2022/09/29 by SUN Yazhou
  \copyright 2020-2023 SUN Yazhou
  \copyright CNOK project, Anyang Normal University, IMP-CAS
*/

#ifndef _TARs_h_
#define _TARs_h_

#include <vector>
#include <string>
#include <map>
#include "TAExpData.h"

using std::vector;
using std::string;
using std::map;

class TARs{
public:
  /// \param: is_p: true: -p; false: -n
  TARs(int a, double sp, double sn, double cse, double dcse);
  virtual ~TARs(){}

  void Initialize();
  void SetIsProtonRemoval(bool isp){ fIsProtonRemoval = isp; }
  bool IsProtonRemoval() const{ return fIsProtonRemoval; }
  /// \param csth: theoretical c.s.
  void AddConfig(const string &orbit, double ex, double c2s, double csth);
  void Rs(); // calculate the Rs
  /// build yaml name from configuration name
  static void YamlName(const string &orbit, char *cfg);

  static const map<char, int> LL; ///< orbital angular momentum notations

protected:
  /// to tell if b is a legal orbit: e.g.: 0p1/2_1/2-, or 1s1/2_1-, or
  bool ob(const string &b);

  bool fIsProtonRemoval;
  int fA; ///< static the mass number of the projectile
  double fSp, fSn; ///< proton and neutron separation energy
  TAExpData fCSExp; ///< the experimental cross section
  vector<string> fOrbit; ///< the list of valence configurations
  vector<double> fEx; ///< core excitation energy for each configuration
  vector<double> fC2S; ///< spectroscopic factors for each configuration
  vector<double> fCSsp; //< single-particle cross section
  vector<double> fCSth; //< theoretical cross sections for each configuration

  double fDeltaS; ///< bouding depth of the removed nucleon
  double fCSthT; ///< the total theoretical cross section
  TAExpData fRs; ///< the reduction factor
};

#endif
